package cn.ac.big.bigd.service;
import cn.ac.big.bigd.dao.SubmissionDao;
import cn.ac.big.bigd.model.User;
import cn.ac.big.bigd.model.submit.Submission;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 *@Author wangfan
 *@Date 2016/11/29 15:53
 */

@Service
public class SubmissionService {


    @Autowired
    SubmissionDao submissionDao;






    public Submission save(Submission submission) {
        return submissionDao.save(submission);
    }

    public Submission findById(long id) {
        return submissionDao.findOne(id);
    }
    public Submission findByMissionId(String id) {
        return submissionDao.findByMissionId(id);
    }

    public List<Submission> findAll() {
        return submissionDao.findAll();
    }

    public List<Submission> findByAccessionStartingWith(String accession) {
        return submissionDao.findByAccessionStartingWith( accession);
    }
    public Submission findByAccession(String accession) {
        return submissionDao.findByAccession( accession);
    }

    public List<Submission> findByUser(User user) {
        return submissionDao.findByUser(user);
    }


    public List<Submission> findBySubStatus(int subStatus) {
        return submissionDao.findBySubStatus(subStatus);
    }

    public List<Submission> findByUserAndIsDeleteNot(User user, boolean isDelete) {
        return submissionDao.findByUserAndIsDeleteNot(user,isDelete);
    }


}
